﻿Imports Controller
Imports Entities
Public Class PrestarLibro
    Private controllerSQL As New NegocioSQL
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Me.Close()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim libro As Libro = cmbIsbn.SelectedItem
        If libro.Isbn = "" Or TxtDni.Text = "" Or TxtFechaP.Text = "" Or TxtFechaD.Text = "" Then
            MessageBox.Show("No puede a ver ningun espacio en blanco")
        Else
            controllerSQL.SQLIntroducirPrestamo(New Prestamo(libro.Isbn, TxtDni.Text, TxtFechaP.Text, TxtFechaD.Text, False))
        End If
    End Sub

    Private Sub Modificar_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        cmbIsbn.DataSource = controllerSQL.SQLgetLibros.ToList
    End Sub
End Class